import { createSlice } from '@reduxjs/toolkit'
// 引入createSlice方法，帮助我们创建reducer

const tabSlice = createSlice({
  name: 'tab',
  initialState: {
    isCollapse: false,
  },
  // 定义一个reducers用于修改他的状态
  reducers: {
    // 定义一个方法，用来修改当前的状态
    collapseMenu: (state) => {
      state.isCollapse = !state.isCollapse
    },
   
  }
})
// 每个 case reducer 函数会生成对应的 Action creators
export const { collapseMenu, selectMenuList, closeTab, setCurrentMenu } = tabSlice.actions
export default tabSlice.reducer